<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html ng-app>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
    <title>${title}</title>
    <%@ include file="/WEB-INF/jsp/commons/meta.jsp" %>
    <link href="${ctx}/resources/new/style.css" type="text/css" rel="stylesheet"/>

</head>
<body>
<script>
    $(document).ready(function () {
        //聚焦第一个输入框
        $("#name").focus();
        //为inputForm注册validate函数
        $("#inputForm").validate({
            rules: {
                addrArea: "required",
                addrCity: "required",
                addrProvince: "required",
                fullName: "required",
                mobile: "required",
                password: "required",
                addrRegion: "required",
                addrDetail: "required",
                registerDate: "required",
                sex: "required",
                email: "required",
                zipCode: "required",
                cardType: "required",
                cardCode: "required",
                registerDepartment: "required",
                phone: "required",
                memo: "required"
            }
        });

        $(".datepicker").datepicker({
            dateFormat: "yy-mm-dd",
            monthNames: [ "- 01月", "- 02月", "- 03月", "- 04月", "- 05月", "- 06月", "- 07月", "- 08月", "- 09月", "- 10月", "- 11月", "- 12月" ],
            showMonthAfterYear: true
        });
    });
</script>
<form:form id="inputForm" class="well form-inline" action="${ctx}/adoms/consumer/save" modelAttribute="consumer"
           method="POST">
    <form:hidden path="id"/>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <i class="icon-flag"></i>
        <strong>消费者表单</strong>
        </thead>
        <tr>
            <td class="span2">姓名:</td>
            <td><form:input path="fullName" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>地区:</td>
            <td><form:input path="addrArea" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>城市:</td>
            <td><form:input path="addrCity" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>省份:</td>
            <td><form:input path="addrProvince" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>手机:</td>
            <td><form:input path="mobile" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>登陆密码:</td>
            <td><form:password path="mobile" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>县/区:</td>
            <td><form:input path="addrRegion" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>联系地址:</td>
            <td><form:input path="addrDetail" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>注册日期:</td>
            <td><form:input path="registerDate" cssClass="datepicker" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>性别:</td>
            <td>
                <form:radiobutton path="sex" label="男" value="M"/>
                <form:radiobutton path="sex" label="女" value="F"/>
            </td>
        </tr>
        <tr>
            <td>邮箱:</td>
            <td><form:input path="email" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>邮编:</td>
            <td><form:input path="zipCode" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>证件类型:</td>
            <td><form:input path="cardType" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>证件号码:</td>
            <td><form:input path="cardCode" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>注册部门:</td>
            <td><form:select path="registerDepartment.id">
                <form:options items="${departments}" itemLabel="name" itemValue="id" size="30" maxlength="80"/>
            </form:select></td>
        </tr>
        <tr>
            <td>电话:</td>
            <td><form:input path="phone" size="30" maxlength="80"/></td>
        </tr>
        <tr>
            <td>备注:</td>
            <td><form:textarea path="memo" rows="4" cssClass="span6"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <input class="btn" type="submit" value="提交"/>
                &nbsp;
                <input class="btn" type="button" value="返回" back="back" onclick="history.go(-1)"/>
            </td>
        </tr>
    </table>
</form:form>
</body>
</html>